import request from '../util/request.js'

export function login(code, data) {
	return request.post("mini/login?code=" + code, data, {
		noAuth: true
	})
}

export function wechatLogin(code) {
	return request.post("wechat/login?code=" + code, {}, {
		noAuth: true
	})
}


export function getUserInfo() {
	return request.post('shop/info', {}, {
		noAuth: false
	})
}


export function sendCode(data) {
	return request.get('shop/user/sendCode', data, {
		noAuth: true
	})
}



export function h5Login(data) {
	return request.post('h5/login', data, {
		noAuth: true
	})
}

export function h5LoginInfo(data) {
	return request.post('shop/h5/login/info', data, {
		noAuth: true
	})
}

export function logout() {
	return request.get('shop/logout', {}, {
		noAuth: false
	})
}




export function userRegister(data) {
	return request.post('shop/user/register', data, {
		noAuth: true
	})
}

export function userUpdatePwd(data) {
	return request.post('shop/user/update/pwd', data, {
		noAuth: true
	})
}

export function saveUserInfo(data) {
	return request.post('shop/user/save/info', data, {
		noAuth: false
	})
}


export function userAuth(data) {
	return request.post('shop/user/auth', data, {
		noAuth: true
	})
}